<html>
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <title>欢迎来到我的主页</title>
    <script type="text/javascript">
              //这个方式是被java调用的
             function androidCallJs(){
             alert("java调用js弹窗");
             }
             // 这个方式是调用java的
             function showToast(){
             android.showToast("js调用Android,我是xxx");
             }
             // js->js->android
             function alertt(){
                var name=document.getElementById("id_name").value;
                alert("name=="+name);
             }
    </script>
</head>
<body>
<h1>interact from js to java by using webview container </h1>
<div data-role="main" class="ui-content">
    <div data-role="main" class="ui-content">
        <input type="button" value="js调用js代码" onClick="androidCallJs()"
               style="font-size:100px; color:blue"/>
    </div>
    <div data-role="main" class="ui-content">
        <input type="button" value="js调用java代码" onClick="showToast()"
               style="font-size:120px;color:green;margin-top:35px"/>
    </div>
    <div data-role="main" class="ui-content">
        <button type="button" onclick="alertt()"
                style="font-size:60px;color:blue;margin-top:35px;padding:20px"> div-button-click
        </button>
    </div>
    <div data-role="main" class="ui-content">
        <input id="id_name" type="text" value="">
    </div>
</div>
</body>
</html>